package com.example.admin.yuejian21.Model;

import com.example.admin.yuejian21.Bean.Login;
import com.example.admin.yuejian21.Bean.Reg;
import com.example.admin.yuejian21.Bean.train;
import com.example.admin.yuejian21.Bean.traindetail;
import com.example.admin.yuejian21.Service.Service;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Admin on 2017/10/12.
 */

public class TrainModel {
    private Retrofit retrofit;
    public TrainModel(){
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }

    public retrofit2.Call<List<train>> getTrainList(){
        Service Service = retrofit.create(Service.class);
        return Service.getTrainList();
    }
    public retrofit2.Call<List<traindetail>> gettrainlists(){
        Service Service = retrofit.create(Service.class);
        return Service.gettrainList();
    }

    public Call<traindetail> gettraininfo(String id){
        Service Service = retrofit.create(Service.class);
        return Service.getTraininfo("lgj98rfkiqvenhrk2o7oe2po81","train",id);
    }
    public Call<List<traindetail>> gettraintype(String Degree){
        Service Service = retrofit.create(Service.class);
        return Service.getallTrain("lgj98rfkiqvenhrk2o7oe2po81","train",Degree);
    }
    public Call<Integer> signTrain(String participantname, String train_id, String participanttel, String adultnum, String paytype,
                                   String pay, String paynotice, int userid) {
        Service Service = retrofit.create(Service.class);
        return Service.signTrain("signtrain", participantname, train_id, participanttel, adultnum, paytype, pay, paynotice, userid, "lgj98rfkiqvenhrk2o7oe2po81");
    }
}